<template>
	<view>
		<u-navbar :is-back="true" title="查看主页"></u-navbar>
		<view class="gerenziliao">
			<view class="gerenziliao-top u-flex">
				<image src="../../static/demo/1.jpg" class="grzl-tx"></image>
				<view class="add-friend u-flex"><image src="../../static/img/index/wode_def.png" class="add-icon"></image> 添加好友</view>
			</view>
			<view class="gerenziliao-infor">
				<view class="name">我的网名叫张三</view>
				<view class="IDnumber">ID：123487</view>
				<view class="renzheng"><image src="../../static/img/index/renzheng.png" class="rz-icon"></image> 已实名认证</view>
			</view>
			<view class="gerenziliao-infor2">
				<text class="jianjie-text">女 18岁</text>
				<text class="jianjie-text">北京 海淀区</text>
				<text class="jianjie-text color-green">详细信息></text>
			</view>
			<view class="gerenziliao-text">好友的个人签名，快来加我好友的个人签名，快来加我为好友吧</view>
			<view class="gerenziliao-total u-flex">
				<view class="total-text">
					<text class="color5">50</text> 视频
				</view>
				<view class="total-text">
					<text class="color5">50</text> 动态
				</view>
				<view class="total-text">
					<text class="color5">50</text> 活动
				</view>
			</view>
		</view>
		<view class="gerenziliao-tab">
			<u-tabs-swiper ref="uTabs" :list="list" :bar-style="barstyle"  :current="current" @change="tabsChange" :is-scroll="false" active-color="#1b1b1b" 
			 swiperWidth="750"></u-tabs-swiper>
		</view>
		<view class="video-tabCont">
			<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="video-swiper">
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
						<view class="video_list_box">
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
							<view class="video_list">
								<image src="../../static/demo/5.jpg" class="video-bg"></image>
								<view class="bofangliang">
									<image src="../../static/img/index/bofang.png" class="bofang-icon"></image> 1564
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '视频'
				}, {
					name: '动态'
				}, {
					name: '活动'
				},
				{
					name: '收藏'
				},
				{
					name: '赞过'
				}
				],
				// 因为内部的滑动机制限制，请将tabs组件和swiper组件的current用不同变量赋值
				current: 0, // tabs组件的current值，表示当前活动的tab选项
				swiperCurrent: 0, // swiper组件的current值，表示当前那个swiper-item是活动的
				barstyle:{
					backgroundColor:'#2ea34a'
				}
			};
		},
		methods: {
					// tabs通知swiper切换
					tabsChange(index) {
						this.swiperCurrent = index;
					},
					// swiper-item左右移动，通知tabs的滑块跟随移动
					transition(e) {
						let dx = e.detail.dx;
						this.$refs.uTabs.setDx(dx);
					},
					// 由于swiper的内部机制问题，快速切换swiper不会触发dx的连续变化，需要在结束时重置状态
					// swiper滑动结束，分别设置tabs和swiper的状态
					animationfinish(e) {
						let current = e.detail.current;
						this.$refs.uTabs.setFinishCurrent(current);
						this.swiperCurrent = current;
						this.current = current;
					},
					// scroll-view到底部加载更多
					onreachBottom() {
						
					}
				}
	}
</script>

<style lang="scss">
.gerenziliao{
	padding: 0 50rpx;
}
.gerenziliao-top{
	justify-content: space-between;
	margin: 32rpx 0;
	.grzl-tx{
		width: 140rpx;
		height: 140rpx;
		border-radius: 100px;
	}
	.add-friend{
		width: 250rpx;
		height: 70rpx;
		line-height: 70rpx;
		justify-content: center;
		background-color: #2ea34a;
		color: #FFFFFF;
		border-radius: 10rpx;
		font-size: 28rpx;
		.add-icon{
			width: 48rpx;
			height: 48rpx;
			margin-right: 15rpx;
		}
	}
}
.gerenziliao-infor{
	display: flex;
	align-items: center;
	.name{
		font-size: 36rpx;
		color: #000;
		width: 43%;
	}
	.IDnumber{
		font-size: 20rpx;
		width: 27%;
	}
	.renzheng{
		font-size: 20rpx;
		display: flex;
		align-items: center;
		width: 30%;
		.rz-icon{
			width: 30rpx;
			height: 30rpx;
			margin-right: 10rpx;
		}
	}
}
.gerenziliao-infor2{
	margin: 35rpx 0 25rpx;
	display: flex;
	align-items: center;
	.jianjie-text{
		width: 33%;
	}
}
.gerenziliao-text{
	margin-bottom: 25rpx;
	font-size: 24rpx;
}
.gerenziliao-total{
	
	.total-text{
		color: #aeaeae;
		margin-right: 30rpx;
	}
}
.gerenziliao-tab{
	padding: 10rpx 0 35rpx;
	border-bottom:4rpx solid #e4e4e4;
	margin-bottom: 30rpx;
}
.video_list{
	position: relative;
	width: 30%;
	height: 280rpx;
	margin-bottom: 3%;
	margin-right: 30rpx;
	.video-bg{
		width: 100%;
		height: 280rpx;
	}
}
.video_list:nth-child(3n+3){
	margin-right: 0;
}
.bofangliang{
	position: absolute;
	bottom: 20rpx;
	left: 20rpx;
	color: #FFFFFF;
	font-size: 24rpx;
	.bofang-icon{
		width: 14rpx;
		height: 16rpx;
		margin-right: 10rpx;
	}
}
.video_list_box{
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	margin: 0 30rpx;
}
page{
	height: 100%;
}
.video-tabCont{
	//height: 600rpx;
}
.video-swiper{
	height: 300px;
}
.swiper-item {
	height: 100%;
}
</style>
